<!DOCTYPE html>
<html lang="en">
    <head>
        <title></title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="../js/vue.js"></script>
    </head>
    <body>
        <div id="app">

                账号<input type="text" v-model ='name'></br>
                密码<input type="text" v-model ='pass'></br>
                <p>{{name+'='+pass}}</p>

        </div>
        <script>
            var vm = new Vue({
                el: '#app',
                watch : {
                    name(){
                        // 可以监听异步操作的变化
                        setTimeout(()=>{
                            console.log('123')
                        },1000)
                       
                    },
                    pass(newCont,oldCont){
                        console.log(newCont,oldCont)
                    }
                },
                data: {
                    name : '',
                    pass : '',
                }
            })
        </script>
    </body>
</html>